home *** CD-ROM | disk | FTP | other *** search
- #!/bin/sh -e
-
- # do the dhcdbd -> zzzz_dhcdbd rename on upgrades
- if [ "$1" = install ] || [ "$1" = upgrade ]; then
- if dpkg --compare-versions "$2" le-nl "2.0-2ubuntu2"; then
- OLD=/etc/dhcp3/dhclient-exit-hooks.d/dhcdbd
- NEW=/etc/dhcp3/dhclient-exit-hooks.d/zzzz_dhcdbd
- if [ -e "$OLD" ]; then
- md5sum="`md5sum \"$OLD\" | sed -e \"s/ .*//\"`"
- old_md5sum="`dpkg -s dhcdbd | sed -n -e \"/^Conffiles:/,/^[^ ]/{\\\\' $OLD'{s/.* //;p}}\"`"
- if [ "$md5sum" = "$old_md5sum" ]; then
- mv -f "$OLD" "$OLD.moved-by-preinst"
- else
- mv -f "$OLD" "$NEW"
- fi
- fi
- fi
- fi
-